package com.template.method.demo03;

public class Hummer1 extends HummerModel{
    @Override
    public void start() {
        System.out.println("悍马1启动");
    }

    @Override
    public void stop() {
        System.out.println("悍马1停止");
    }

    @Override
    public void alarm() {
        System.out.println("悍马1鸣笛");
    }

    @Override
    public void engineBoom() {
        System.out.println("悍马1引擎咆哮");
    }

    // 共外界控制是否鸣笛
    private boolean alarmFlag = true;
    public void setAlarm(boolean isAlarm){
        this.alarmFlag = isAlarm;
    }

    // 重写是否鸣笛
    protected boolean isAlarm(){
        return this.alarmFlag;
    }
}
